<html>
<head>
	<title>Degrees</title>
</head>
<body>



<form method="post" action="cels.php">
	<input name="degree">
	<select name="type">
		<option value="1">C - F</option>
		<option value="2">F - C</option>
	</select>
	<input type="submit" name="submit" value="Check"/>
	
</form>
</body>
</html>
<?php
	//if(count($_POST) > 0 )
		$_POST['submit'];
		$option = $_POST['type'];
		if($option == 1){
		if(isset($_POST['submit']))
			{
			$cels = $_POST['degree'];
			$far = $_POST['degree']*9/5 + 32;
			echo "$cels C is  $far F ";
			}}
		else {
		$far = $_POST['degree'];
		$cels = ($_POST['degree'] - 32)*5/9;
		echo "$far F is  $cels C ";
		}	
?>
